    <?php 
        require_once('header_sidebar.php');
        require_once('Class/evaluation.Class.php');
        require_once('Class/displayInHtml.Class.php');
        require_once('Class/connexionDB.Class.php');

        $db = new connexionDB();
        $unacceptable = $db->getUnacceptable();
    ?>
    <aside class="right-side">
        <section class="content-header">
            <h1>
                <?php echo $translate->translate('CreateRatingTitle'); ?>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i><?php echo $translate->translate('HomePageRating'); ?></a></li>
                <li class="active"><?php echo $translate->translate('CreateRatingTitle'); ?></li>
            </ol>
        </section>
        <section class="content">
            <div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog text">
                    <div class="modal-content">
                     <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 id='evaluation_title' class="modal-title"><?php echo $translate->translate('evaluationForm'); ?></h4>
                      </div>
                      <div class="modal-body">
                        <div class="alert alert-success alert-dismissable">
                            <i class="fa fa-check"></i>
                            <b><?php echo $translate->translate('updateEval'); ?></b>
                        </div>
                      </div>
                      <div class="modal-footer">
                            <button type="button" class="btn btn-default" onclick="location.reload();"><?php echo $translate->translate('validate'); ?></button>
                      </div>
                    </div>
                </div>
            </div>
            <div id="add_new_eval" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog text">
                    <div class="modal-content">
                     <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 id='evaluation_title' class="modal-title"><?php echo $translate->translate('nameEval'); ?></h4>
                      </div>
                      <div class="modal-body">
                            <input id="title_eval" type="text" class="form-control">
                      </div>
                      <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $translate->translate('AdminDeleteAccountPopupAlertCancel'); ?></button>
                            <button id='new_eval_validate' type="button" class="btn btn-success" >Valider</button>
                      </div>
                    </div>
                </div>
            </div>
            <div id="add_level_mark" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog text">
                    <div class="modal-content">
                     <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 id='evaluation_title' class="modal-title"><?php echo $translate->translate('AddLevelRating'); ?></h4>
                      </div>
                      <div class="modal-body new_mark_div">
                        <div class="box-tools pull-right" data-toggle="tooltip">
                            <div class="btn-group" data-toggle="btn-toggle" tabindex='-2'>
                                <button id="normal" type="button" class="btn btn-default btn-sm type-request active">Normal</button>
                                <button id="unacceptable" type="button" class="btn btn-default btn-sm type-request">Inacceptable</button>
                            </div>
                        </div>
                        <div id='unacceptable_div' hidden>
                            <label for="selectUnacceptable"><?php echo $translate->translate('ExampleListTopic'); ?></label>
                            <select id="selectUnacceptable" class="form-control">
                                <option><?php echo $translate->translate('TitleSelectEvaluationDefault'); ?></option>
                                <?php 
                                    foreach ($unacceptable as $key => $value)
                                    {
                                        echo "<option value='".$value['id']."'>". $value['description'] ."</option>";
                                    }
                                ?>
                            </select>
                        </div>
                        <div id='normal_div'>
                            <label><?php echo $translate->translate('LevelRating'); ?> : </label>
                            <input class="form-control" type='text' id='new_mark_name'>
                            <label><?php echo $translate->translate('MarkCriteria'); ?> : </label>
                            <input class="form-control" type='text' id='new_mark'>
                        </div>
                      </div>
                      <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $translate->translate('AdminDeleteAccountPopupAlertCancel'); ?></button>       
                            <button id="add_level_mark_validate" type="button" class="btn btn-success" ><?php echo $translate->translate('validate'); ?></button>       
                      </div>
                    </div>
                </div>
            </div>
            <div class="box">
                <div class="box-header">
                    <br>
                    <div class="col-md-10">
                        <div class="alert alert-warning alert-dismissable">
                            <i class="fa fa-warning"></i>
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <b><?php echo $translate->translate('descriptionCreateEvaluationTitle'); ?>!</b> <?php echo $translate->translate('descriptionCreateEvaluationDescription'); ?>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <?php 
                                $eval   = new evaluation();
                                $listedEval = $eval->listedEvalForm();
                            ?>
                            <label><?php echo $translate->translate('loadEvaluation'); ?></label>
                            <div class="input-group input-group-sm">
                                <select id="selectedEvaluation" name="selectedEvaluation" class="form-control" placeholder='test'>
                                    <option disabled selected><?php echo $translate->translate('TitleSelectEvaluationDefault'); ?></option>
                                    <?php 
                                        foreach ($listedEval as $key => $value)
                                        {
                                            echo '<option value='.$value['id'].'>'. $value['name'] .'</option>';
                                        }
                                    ?>
                                </select>
                                <span class="input-group-btn">
                                    <button id="selectEval" class="btn btn-info btn-flat" type="submit"><?php echo $translate->translate('TitleSelectEvaluationbtn'); ?></button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div id="table_evaluation" class="box-body">
                        <table id="table_result" class="table table-bordered" style="text-align:center;">
                            <tr id ="headerTab" class="bg-aqua">
                                <th><?php echo $translate->translate('NameCriteria'); ?></th>
                                <th ><?php echo $translate->translate('DescriptionCriteria'); ?></th>
                                <th id="coeff" width="2%"><?php echo $translate->translate('CoefficientTitle'); ?> S(Coeff) = 1</th>
                                <th id="notApply" width="2%"><?php echo $translate->translate('setToZero'); ?></th>
                            </tr>
                            <tr id='footerTab' hidden ></tr>
                        </table>
                        <div class="box-footer">
                            <button id="addCriteria" type="submit" class="btn btn-info"><?php echo $translate->translate('AddCriteria'); ?></button>
                            <button id="addLevelRating" type="submit" class="btn btn-info"><?php echo $translate->translate('AddLevelRating'); ?></button>
                        </div>
                        <div class="box-footer pull-right">
                            <button id="saveAs" type="submit" class="btn btn-success"><?php echo $translate->translate('saveAs'); ?></button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </aside>
</div>
<?php require_once('footer.php');?>
<script type="text/javascript" src="js/edit_eval.js"></script>        